<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div>您将在xx秒后跳转至百度</div>

</body>

<script>
    let div = document.querySelector('div');
    let timer = 5;
    let down = function() {
        if (timer == 0) {
            location.href = 'https://www.baidu.com';
        } else {
            div.innerHTML = '您将在' + timer + '秒后跳转至百度';
            timer--;
        }
    };
    down();
    setInterval(down, 1000);
</script>

</html>